.TH "Album browsing" 3spotify "Wed Mar 28 2012" "libspotify" \" -*- nroff -*-
.ad l
.nh
.SH NAME
Album browsing \- 
.SS "Typedefs"

.in +1c
.ti -1c
.RI "typedef void \fBalbumbrowse_complete_cb\fP (\fBsp_albumbrowse\fP *result, void *userdata)"
.br
.in -1c
.SS "Functions"

.in +1c
.ti -1c
.RI "\fBsp_albumbrowse\fP * \fBsp_albumbrowse_create\fP (\fBsp_session\fP *session, \fBsp_album\fP *album, \fBalbumbrowse_complete_cb\fP *callback, void *userdata)"
.br
.ti -1c
.RI "bool \fBsp_albumbrowse_is_loaded\fP (\fBsp_albumbrowse\fP *alb)"
.br
.ti -1c
.RI "\fBsp_error\fP \fBsp_albumbrowse_error\fP (\fBsp_albumbrowse\fP *alb)"
.br
.ti -1c
.RI "\fBsp_album\fP * \fBsp_albumbrowse_album\fP (\fBsp_albumbrowse\fP *alb)"
.br
.ti -1c
.RI "\fBsp_artist\fP * \fBsp_albumbrowse_artist\fP (\fBsp_albumbrowse\fP *alb)"
.br
.ti -1c
.RI "int \fBsp_albumbrowse_num_copyrights\fP (\fBsp_albumbrowse\fP *alb)"
.br
.ti -1c
.RI "const char * \fBsp_albumbrowse_copyright\fP (\fBsp_albumbrowse\fP *alb, int index)"
.br
.ti -1c
.RI "int \fBsp_albumbrowse_num_tracks\fP (\fBsp_albumbrowse\fP *alb)"
.br
.ti -1c
.RI "\fBsp_track\fP * \fBsp_albumbrowse_track\fP (\fBsp_albumbrowse\fP *alb, int index)"
.br
.ti -1c
.RI "const char * \fBsp_albumbrowse_review\fP (\fBsp_albumbrowse\fP *alb)"
.br
.ti -1c
.RI "int \fBsp_albumbrowse_backend_request_duration\fP (\fBsp_albumbrowse\fP *alb)"
.br
.ti -1c
.RI "void \fBsp_albumbrowse_add_ref\fP (\fBsp_albumbrowse\fP *alb)"
.br
.ti -1c
.RI "void \fBsp_albumbrowse_release\fP (\fBsp_albumbrowse\fP *alb)"
.br
.in -1c
.SH "Detailed Description"
.PP 
Browsing adds additional information to what an \fBsp_album\fP holds\&. It retrieves copyrights, reviews and tracks of the album\&. 
.SH "Typedef Documentation"
.PP 
.SS "typedef void \fBalbumbrowse_complete_cb\fP(\fBsp_albumbrowse\fP *result, void *userdata)"
The type of a callback used in \fBsp_albumbrowse_create()\fP
.PP
When the callback is called, the metadata of all tracks belonging to it will have been loaded, so \fBsp_track_is_loaded()\fP will return non-zero\&. The \fBsp_artist\fP of the album will also have been fully loaded\&.
.PP
\fBParameters:\fP
.RS 4
\fIresult\fP The same pointer returned by \fBsp_albumbrowse_create()\fP 
.br
\fIuserdata\fP The opaque pointer given to \fBsp_albumbrowse_create()\fP 
.RE
.PP

.SH "Function Documentation"
.PP 
.SS "void \fBsp_albumbrowse_add_ref\fP (\fBsp_albumbrowse\fP *alb)"
Increase the reference count of an album browse result
.PP
\fBParameters:\fP
.RS 4
\fIalb\fP The album browse result object 
.RE
.PP

.SS "\fBsp_album\fP* \fBsp_albumbrowse_album\fP (\fBsp_albumbrowse\fP *alb)"
Given an album browse object, return the pointer to its album object
.PP
\fBParameters:\fP
.RS 4
\fIalb\fP Album browse object
.RE
.PP
\fBReturns:\fP
.RS 4
Album object 
.RE
.PP

.PP
\fBExamples: \fP
.in +1c
\fBbrowse\&.c\fP\&.
.SS "\fBsp_artist\fP* \fBsp_albumbrowse_artist\fP (\fBsp_albumbrowse\fP *alb)"
Given an album browse object, return the pointer to its artist object
.PP
\fBParameters:\fP
.RS 4
\fIalb\fP Album browse object
.RE
.PP
\fBReturns:\fP
.RS 4
Artist object 
.RE
.PP

.SS "int \fBsp_albumbrowse_backend_request_duration\fP (\fBsp_albumbrowse\fP *alb)"
Return the time (in ms) that was spent waiting for the Spotify backend to serve the request
.PP
\fBParameters:\fP
.RS 4
\fIalb\fP Album browse object
.RE
.PP
\fBReturns:\fP
.RS 4
-1 if the request was served from the local cache If the result is not yet loaded the return value is undefined 
.RE
.PP

.SS "const char* \fBsp_albumbrowse_copyright\fP (\fBsp_albumbrowse\fP *alb, intindex)"
Given an album browse object, return one of its copyright strings
.PP
\fBParameters:\fP
.RS 4
\fIalb\fP Album browse object 
.br
\fIindex\fP The index for the copyright string\&. Should be in the interval [0, \fBsp_albumbrowse_num_copyrights()\fP - 1]
.RE
.PP
\fBReturns:\fP
.RS 4
Copyright string in UTF-8 format, or NULL if the index is invalid\&. Returned string is valid as long as the album object stays allocated and no longer than the next call to \fBsp_session_process_events()\fP 
.RE
.PP

.PP
\fBExamples: \fP
.in +1c
\fBbrowse\&.c\fP\&.
.SS "\fBsp_albumbrowse\fP* \fBsp_albumbrowse_create\fP (\fBsp_session\fP *session, \fBsp_album\fP *album, \fBalbumbrowse_complete_cb\fP *callback, void *userdata)"
Initiate a request for browsing an album
.PP
The user is responsible for freeing the returned album browse using \fBsp_albumbrowse_release()\fP\&. This can be done in the callback\&.
.PP
\fBParameters:\fP
.RS 4
\fIsession\fP Session object 
.br
\fIalbum\fP Album to be browsed\&. The album metadata does not have to be loaded 
.br
\fIcallback\fP Callback to be invoked when browsing has been completed\&. Pass NULL if you are not interested in this event\&. 
.br
\fIuserdata\fP Userdata passed to callback\&.
.RE
.PP
\fBReturns:\fP
.RS 4
Album browse object
.RE
.PP
\fBSee also:\fP
.RS 4
\fBalbumbrowse_complete_cb\fP 
.RE
.PP

.PP
\fBExamples: \fP
.in +1c
\fBbrowse\&.c\fP\&.
.SS "\fBsp_error\fP \fBsp_albumbrowse_error\fP (\fBsp_albumbrowse\fP *alb)"
Check if browsing returned an error code\&.
.PP
\fBParameters:\fP
.RS 4
\fIalb\fP Album browse object
.RE
.PP
\fBReturns:\fP
.RS 4
One of the following errors, from \fBsp_error\fP SP_ERROR_OK SP_ERROR_IS_LOADING SP_ERROR_OTHER_PERMANENT SP_ERROR_OTHER_TRANSIENT 
.RE
.PP

.PP
\fBExamples: \fP
.in +1c
\fBbrowse\&.c\fP\&.
.SS "bool \fBsp_albumbrowse_is_loaded\fP (\fBsp_albumbrowse\fP *alb)"
Check if an album browse request is completed
.PP
\fBParameters:\fP
.RS 4
\fIalb\fP Album browse object
.RE
.PP
\fBReturns:\fP
.RS 4
True if browsing is completed, false if not 
.RE
.PP

.SS "int \fBsp_albumbrowse_num_copyrights\fP (\fBsp_albumbrowse\fP *alb)"
Given an album browse object, return number of copyright strings
.PP
\fBParameters:\fP
.RS 4
\fIalb\fP Album browse object
.RE
.PP
\fBReturns:\fP
.RS 4
Number of copyright strings available, 0 if unknown 
.RE
.PP

.PP
\fBExamples: \fP
.in +1c
\fBbrowse\&.c\fP\&.
.SS "int \fBsp_albumbrowse_num_tracks\fP (\fBsp_albumbrowse\fP *alb)"
Given an album browse object, return number of tracks
.PP
\fBParameters:\fP
.RS 4
\fIalb\fP Album browse object
.RE
.PP
\fBReturns:\fP
.RS 4
Number of tracks on album 
.RE
.PP

.PP
\fBExamples: \fP
.in +1c
\fBbrowse\&.c\fP\&.
.SS "void \fBsp_albumbrowse_release\fP (\fBsp_albumbrowse\fP *alb)"
Decrease the reference count of an album browse result
.PP
\fBParameters:\fP
.RS 4
\fIalb\fP The album browse result object 
.RE
.PP

.PP
\fBExamples: \fP
.in +1c
\fBbrowse\&.c\fP\&.
.SS "const char* \fBsp_albumbrowse_review\fP (\fBsp_albumbrowse\fP *alb)"
Given an album browse object, return its review
.PP
\fBParameters:\fP
.RS 4
\fIalb\fP Album browse object
.RE
.PP
\fBReturns:\fP
.RS 4
Review string in UTF-8 format\&. Returned string is valid as long as the album object stays allocated and no longer than the next call to \fBsp_session_process_events()\fP 
.RE
.PP

.PP
\fBExamples: \fP
.in +1c
\fBbrowse\&.c\fP\&.
.SS "\fBsp_track\fP* \fBsp_albumbrowse_track\fP (\fBsp_albumbrowse\fP *alb, intindex)"
Given an album browse object, return a pointer to one of its tracks
.PP
\fBParameters:\fP
.RS 4
\fIalb\fP Album browse object 
.br
\fIindex\fP The index for the track\&. Should be in the interval [0, \fBsp_albumbrowse_num_tracks()\fP - 1]
.RE
.PP
\fBReturns:\fP
.RS 4
A track\&.
.RE
.PP
\fBSee also:\fP
.RS 4
\fBTrack subsystem\fP 
.RE
.PP

.PP
\fBExamples: \fP
.in +1c
\fBbrowse\&.c\fP\&.
.SH "Author"
.PP 
Generated automatically by Doxygen for libspotify from the source code\&.
